package com.javandad.app.shared.entity.search;

import java.util.Date;
import java.util.List;

public class AdvancedUserSearchProperties extends FreetextSearchProperties
{
	private static final long serialVersionUID = 7373599646118834868L;
	
	Date creationDateStart;
	Date creationDateEnd;
	String email;
	List<String> countries;
	List<String> cities;
	
	public AdvancedUserSearchProperties(String freetext, Date creationDateStart, Date creationDateEnd, String email, List<String> countries,
			List<String> cities)
	{
		super(freetext, FreetextSearchProperties.SEARCH_FOR_USER);		
		this.creationDateStart = creationDateStart;
		this.creationDateEnd = creationDateEnd;
		this.email = email;
		this.countries = countries;
		this.cities = cities;
	}
	@SuppressWarnings("unused")
	private AdvancedUserSearchProperties() {}
	
	public Date getCreationDateStart()
	{
		return creationDateStart;
	}
	public void setCreationDateStart(Date creationDateStart)
	{
		this.creationDateStart = creationDateStart;
	}
	public Date getCreationDateEnd()
	{
		return creationDateEnd;
	}
	public void setCreationDateEnd(Date creationDateEnd)
	{
		this.creationDateEnd = creationDateEnd;
	}
	public String getEmail()
	{
		return email;
	}
	public void setEmail(String email)
	{
		this.email = email;
	}
	public List<String> getCountries()
	{
		return countries;
	}
	public void setCountries(List<String> countries)
	{
		this.countries = countries;
	}
	public List<String> getCities()
	{
		return cities;
	}
	public void setCities(List<String> cities)
	{
		this.cities = cities;
	}
	
	public boolean anythingSet() {
		return (creationDateStart != null || creationDateEnd != null || email != null || countries != null || cities != null);
	}
	@Override
	public String toString() {
		String s = super.toString();
		s += ", UserOpts(";
		if(creationDateStart != null)
			s += "from: "+creationDateStart;
		if(creationDateEnd != null)
			s += "to: "+creationDateEnd;
		if(email != null)
			s += "email: "+email;
		if(countries != null)
			s += "countries: "+countries;
		if(cities != null)
			s += "cities: "+cities;
		s += ")";
		return s;
	}

}
